package com.codef.sharp.common.core.enums;

/**
 * 响应对象状态枚举
 * @author zhanrf
 * @date 2022/1/21 15:22
 */
public enum ResponseStatus {
    /**
     * 操作成功
     */
    OK("000000", "操作成功"),
    /**
     * 服务器出了点小差
     */
    FAIL("E00001", "服务器出了点小差"),
    /**
     * 参数验证失败
     */
    METHOD_ARGUMENT_NOT_VALID("E00002", "参数验证失败"),
    /**
     * 鉴权失败
     */
    UNAUTHORIZED("E00003", "鉴权失败"),
    /**
     * 权限不足
     */
    NOT_PERMISSION("E00004", "权限不足"),
    /**
     * 数据异常
     */
    DATA_ERROR("E00005", "数据异常，请刷新后重新操作"),
    /**
     * token过期
     */
    TOKEN_EXPIRE("E00005", "token过期，请重新登录");

    private final String code;

    private final String msg;

    public String value() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    ResponseStatus(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ResponseEnum{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + "} " + super.toString();
    }
}
